//
//  ComunicationsUtils.m
//  Interventix
//
//  Created by Diego on 04/11/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ComunicationsUtils.h"
#import "CommonCrypto/CommonCryptor.h"
#import "NSData+AESCrypt.h"
#import "NSString+AESCrypt.h"
#import "ASIHTTPRequest.h"
#import "ASIFormDataRequest.h"
#import "NSData+Conversion.h"
#import "Define.h"

@implementation ComunicationsUtils



+(NSString *) getUrl{
    //NSString *url = [[NSUserDefaults standardUserDefaults]objectForKey:URL];
    //if(url == nil) return nil;
    
    NSString *s = [NSString stringWithFormat:@"http://%@/connector",URL_CONNECTION];
    return s;
}
+(NSString *) getBaseUrl{
    return URL_CONNECTION;//[[NSUserDefaults standardUserDefaults]objectForKey:URL_CONNECTION];
}

/*+(void) setBaseUrl:(NSString *) url{
    [[NSUserDefaults standardUserDefaults] setObject:url forKey:URL_CONNECTION];
}*/

+(NSNumber *) getIDUserLogged{
    if([[NSUserDefaults standardUserDefaults] objectForKey:SAVE_USER] == nil)return nil;
     NSDictionary * diz = [[NSUserDefaults standardUserDefaults] objectForKey:SAVE_USER];
    return [NSNumber numberWithInt:[[diz objectForKey:@"idutente"] intValue]];
}

+(NSDictionary *) getUserLogged{
    if([[NSUserDefaults standardUserDefaults] objectForKey:SAVE_USER] == nil)return nil;
    NSDictionary * diz = [[NSUserDefaults standardUserDefaults] objectForKey:SAVE_USER];
    return diz;
}

@end
